<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>现场收料</title>
		<link rel="stylesheet" type="text/css" href="../static/common.css"/>
		<link rel="stylesheet" type="text/css" href="static/css/enter.css"/>
	</head>
	<body>
		<div class="enter" id="enter">
			<div class="search">
				<p>
					<input type="text" placeholder="输入一个供应商" class="input" style="width:350px;margin-right: 20px;" v-model="supplierName" @keydown.enter="getData">
					<button type="button" class="btnBlue" @click="getData">搜索</button>
				</p>
			</div>
			<div class="content">
				<ul class="materType mt20" v-for="val,index in list">
					<h3>{{val.type}}</h3>
					<li class="comMater">
						<span class="mt20" v-for="value,i in val.supplier" @click="choose(index,i)">{{value.name}}</span>
					</li>
				</ul>
			</div>
			
		</div>
	</body>
</html>
<script src="../static/js/jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
<script src="../static/dx.js" type="text/javascript" charset="utf-8"></script>
<script src="../static/js/vue.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	var vm = new Vue({
		el:"#enter",
		mounted:function(){
			this.getData();
		},
		data:{
			'supplierName':'',
			'list':[],
		},
		methods:{
			getData:function(){//获取数据
				var $this = this;
				DX.ajax_method({
					'url':'/materials/supply/supplier/findSupplierWithType',
					'param':{'supplierName':$this.supplierName},
					'callBack':function(res){
						if(res.code == 200){
							console.log(res);
							$this.list = res.data;
						}
					}
				})
			},
			choose:function(index,index1){//进入选择
				var id = this.list[index].supplier[index1].id;
				window.location.href = 'choose.html?id='+id;
				
			}
		}
		
	})
</script>